package com.xnx.service;

import com.xnx.bean.QueryBO;
import com.xnx.bean.User;
import com.xnx.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserServiceImpl implements UserService {

    @Autowired
    UserMapper userMapper;
    @Override
    public List<User> selectUser(QueryBO queryBO) {
        List<User> userList = userMapper.selectUser(queryBO);
        return userList;
    }

    @Override
    public int add(User user) {
        int affectedRows = userMapper.add(user);
        if (affectedRows > 0){
            return 200;
        }else {
            return 404;
        }
    }
}
